Skip to content

SM feature#11

Merged
al1img merged 15 commits intoaosedge:developfrom
MykolaSuperman:sm_feature
Jun 24, 2025
Merged

SM feature#11
al1img merged 15 commits intoaosedge:developfrom
MykolaSuperman:sm_feature

Conversation

@MykolaSuperman
Copy link

No description provided.

# SPDX-License-Identifier: Apache-2.0
#

cmake_minimum_required(VERSION 3.19)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commit message:

sm: cmake:

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


#include <aos/common/cloudprotocol/cloudprotocol.hpp>
#include <config/config.hpp>

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove empty line in all the cases

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -23,7 +23,7 @@ void AosCore::Init(const std::string& configFile)
auto err = mLogger.Init();
AOS_ERROR_CHECK_AND_THROW(err, "can't initialize logger");

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commit message:

sm: app: use...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

return ErrorEnum::eNone;
}

Error Database::AddInstanceNetworkInfo(const sm::networkmanager::InstanceNetworkInfo& info)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commit message:

sm: database: implement....

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

{
LOG_DBG() << "Set CNI configuration directory: configDir=" << configDir.CStr();

mConfigDir = std::filesystem::path(configDir.CStr()) / "results";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commit message:

sm: cni: move...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


Error TrafficMonitor::DeleteTrafficChain(const std::string& chain, const std::string& rootChain)
{
if (chain.empty()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commit message:

sm: network: check...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


std::string GetMigrationSourceDir()
{
std::filesystem::path curFilePath(__FILE__);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commit message:

sm: database: use macro...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

std::filesystem::path migrationSourceDir = curFilePath.parent_path() / "../.." / "src/database/migration/";

return std::filesystem::canonical(migrationSourceDir).string();
#ifndef DATABASE_MIGRATION_PATH
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where the macro is defined? It should be part of CONFIG_ I guess.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it defined in cmake file for this test


add_subdirectory(${AOS_CORE_API_DIR} aos_core_api)
add_subdirectory(${AOS_CORE_LIB_DIR}/src/common aos_core_lib/common)
if(WITH_SM)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add empty line before if

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@MykolaSuperman MykolaSuperman force-pushed the sm_feature branch 2 times, most recently from 1f4104f to 79df765 Compare June 24, 2025 07:13
@codecov
Copy link

codecov bot commented Jun 24, 2025

Codecov Report

Attention: Patch coverage is 83.52941% with 14 lines in your changes missing coverage. Please review.

Please upload report for BASE (develop@370706a). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/sm/database/database.cpp 75.75% 8 Missing ⚠️
src/sm/networkmanager/tests/mocks/storagemock.hpp 0.00% 3 Missing ⚠️
src/sm/app/aoscore.cpp 0.00% 1 Missing ⚠️
src/sm/app/app.cpp 0.00% 1 Missing ⚠️
src/sm/networkmanager/trafficmonitor.cpp 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             develop      #11   +/-   ##
==========================================
  Coverage           ?   78.47%           
==========================================
  Files              ?      193           
  Lines              ?    21088           
  Branches           ?     2037           
==========================================
  Hits               ?    16549           
  Misses             ?     4539           
  Partials           ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Poco::Util
)

if(WITH_SM_API)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like a redundant condition: WITH_SM_API is set to ON if with_sm is set to ON

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

aoscommon
aossm
${COMMON_NAMESPACE}::iamclient
${COMMON_NAMESPACE}::jsonprovider
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was agreed to use aos::common:: explicitly

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

# ######################################################################################################################

target_link_libraries(${TARGET} PUBLIC aosutils aoscommon Poco::JSON)
set(LOG_MODULE_NAME resourcemanager)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOG_MODULE_NAME is boolean & not required in this context

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, done

Copy link
Member

@mlohvynenko mlohvynenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed-by: Mykhailo Lohvynenko <mykhailo_lohvynenko@epam.com>

@al1img
Copy link
Collaborator

al1img commented Jun 24, 2025

Reviewed-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>

@mykola-kobets-epam
Copy link
Collaborator

Reviewed-by: Mykola Kobets <mykola_kobets@epam.com>

Mykola Solianko added 15 commits June 24, 2025 16:20
Signed-off-by: Mykola Solianko <mykola_solianko@epam.com>
Reviewed-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
Reviewed-by: Mykola Solianko <mykola_solianko@epam.com>
Reviewed-by: Mykhailo Lohvynenko <mykhailo_lohvynenko@epam.com>
Signed-off-by: Mykola Solianko <mykola_solianko@epam.com>
Reviewed-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
Reviewed-by: Mykola Solianko <mykola_solianko@epam.com>
Reviewed-by: Mykhailo Lohvynenko <mykhailo_lohvynenko@epam.com>
Signed-off-by: Mykola Solianko <mykola_solianko@epam.com>
Reviewed-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
Reviewed-by: Mykola Solianko <mykola_solianko@epam.com>
Reviewed-by: Mykhailo Lohvynenko <mykhailo_lohvynenko@epam.com>
Signed-off-by: Mykola Solianko <mykola_solianko@epam.com>
Reviewed-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
Reviewed-by: Mykola Solianko <mykola_solianko@epam.com>
Reviewed-by: Mykhailo Lohvynenko <mykhailo_lohvynenko@epam.com>
Signed-off-by: Mykola Solianko <mykola_solianko@epam.com>
Reviewed-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
Reviewed-by: Mykola Solianko <mykola_solianko@epam.com>
Reviewed-by: Mykhailo Lohvynenko <mykhailo_lohvynenko@epam.com>
Signed-off-by: Mykola Solianko <mykola_solianko@epam.com>
Reviewed-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
Reviewed-by: Mykola Solianko <mykola_solianko@epam.com>
Reviewed-by: Mykhailo Lohvynenko <mykhailo_lohvynenko@epam.com>
Signed-off-by: Mykola Solianko <mykola_solianko@epam.com>
Reviewed-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
Reviewed-by: Mykola Solianko <mykola_solianko@epam.com>
Reviewed-by: Mykhailo Lohvynenko <mykhailo_lohvynenko@epam.com>
Signed-off-by: Mykola Solianko <mykola_solianko@epam.com>
Reviewed-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
Reviewed-by: Mykola Solianko <mykola_solianko@epam.com>
Reviewed-by: Mykhailo Lohvynenko <mykhailo_lohvynenko@epam.com>
Signed-off-by: Mykola Solianko <mykola_solianko@epam.com>
Reviewed-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
Reviewed-by: Mykola Solianko <mykola_solianko@epam.com>
Reviewed-by: Mykhailo Lohvynenko <mykhailo_lohvynenko@epam.com>
Signed-off-by: Mykola Solianko <mykola_solianko@epam.com>
Reviewed-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
Reviewed-by: Mykola Solianko <mykola_solianko@epam.com>
Reviewed-by: Mykhailo Lohvynenko <mykhailo_lohvynenko@epam.com>
Signed-off-by: Mykola Solianko <mykola_solianko@epam.com>
Reviewed-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
Reviewed-by: Mykola Solianko <mykola_solianko@epam.com>
Reviewed-by: Mykhailo Lohvynenko <mykhailo_lohvynenko@epam.com>
Signed-off-by: Mykola Solianko <mykola_solianko@epam.com>
Reviewed-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
Reviewed-by: Mykola Solianko <mykola_solianko@epam.com>
Reviewed-by: Mykhailo Lohvynenko <mykhailo_lohvynenko@epam.com>
Signed-off-by: Mykola Solianko <mykola_solianko@epam.com>
Reviewed-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
Reviewed-by: Mykola Solianko <mykola_solianko@epam.com>
Reviewed-by: Mykhailo Lohvynenko <mykhailo_lohvynenko@epam.com>
Signed-off-by: Mykola Solianko <mykola_solianko@epam.com>
Reviewed-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
Reviewed-by: Mykola Solianko <mykola_solianko@epam.com>
Reviewed-by: Mykhailo Lohvynenko <mykhailo_lohvynenko@epam.com>
Signed-off-by: Mykola Solianko <mykola_solianko@epam.com>
Reviewed-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
Reviewed-by: Mykola Solianko <mykola_solianko@epam.com>
Reviewed-by: Mykhailo Lohvynenko <mykhailo_lohvynenko@epam.com>
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarQube Cloud

@al1img al1img merged commit 472adc3 into aosedge:develop Jun 24, 2025
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants